package com.android1.amarena2d.test;

import com.android1.amarena2d.nodes.FpsLabel;
import com.android1.amarena2d.nodes.Scene;
import com.android1.amarena2d.nodes.sprites.SharedSprite;
import com.android1.amarena2d.texture.CustomTextureAtlas;
import com.android1.amarena2d.texture.ManagedTexture;
import com.badlogic.gdx.graphics.Color;

public class TextureAtlasExampleScene extends Scene {


    public TextureAtlasExampleScene() {

        engine.getRenderer().setClearColor(Color.WHITE);

        //place the default FPS counter into the screen
        add(new FpsLabel(10, 20, Color.BLACK));

        ManagedTexture managedTexture = engine.getTextureManager().getTexture("assets/map.png");

        CustomTextureAtlas atlas = new CustomTextureAtlas(managedTexture);
        atlas.add(0, 50, 100, 100);
        atlas.add(100, 50, 100, 100);
        atlas.add(0, 150, 100, 100);
        atlas.add(100, 150, 100, 100);


        SharedSprite s1 = new SharedSprite(atlas.getTextureFrame(0), 150, 250);
        add(s1);
        SharedSprite s2 = new SharedSprite(atlas.getTextureFrame(1), 270, 250);
        add(s2);
        SharedSprite s3 = new SharedSprite(atlas.getTextureFrame(2), 150, 130);
        add(s3);
        SharedSprite s4 = new SharedSprite(atlas.getTextureFrame(3), 270, 130);
        add(s4);


    }


}